/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.enrstu.service.impl;

import cn.hutool.core.util.IdUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.enrstu.domain.EnrollmentParameter;
import me.zhengjie.modules.enrstu.repository.EnrollmentParameterRepository;
import me.zhengjie.modules.enrstu.service.EnrollmentParameterService;
import me.zhengjie.modules.enrstu.service.dto.EnrollmentParameterDto;
import me.zhengjie.modules.enrstu.service.dto.EnrollmentParameterQueryCriteria;
import me.zhengjie.modules.enrstu.service.mapstruct.EnrollmentParameterMapper;
import me.zhengjie.utils.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* @website https://eladmin.vip
* @description 服务实现
* @author yyx
* @date 2024-11-04
**/
@Service
@RequiredArgsConstructor
public class EnrollmentParameterServiceImpl implements EnrollmentParameterService {

    private final EnrollmentParameterRepository enrollmentParameterRepository;
    private final EnrollmentParameterMapper enrollmentParameterMapper;

    /**
     * 根据type_label获取报名参数表信息
     * @param typeLabel /
     * @return /
     */
    @Override
    public List<EnrollmentParameterDto> findByTypeLabel(String typeLabel) {

        return enrollmentParameterRepository.findByTypeLabel(typeLabel).stream().map(enrollmentParameterMapper::toDto).collect(Collectors.toList());

    }

}